import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';

import '../base/base_app.dart';

/// 创建人： Created by zhaolong
/// 创建时间：Created by  on 2021/9/25.
///
/// gongzhonghao biglead
/// https://study.163.com/instructor/1021408098.htm
/// https://blog.csdn.net/zl18603543572
/// https://www.toutiao.com/c/user/token/MS4wLjABAAAAYMrKikomuQJ4d-cPaeBqtAK2cQY697Pv9xIyyDhtwIM/
///
///
///

//应用入口
void main() {
  ///启动根目录
  runApp(BaseApp(
    homeWidget:  Example408(),
  ));
}

class Example408 extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _ExampleState();
  }
}

class _ExampleState extends State<Example408> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("手势识别"),
      ),
      backgroundColor: Colors.grey[200],
      body: buildGestureDetector(),
    );
  }

  ///代码清单 4-6
  ///lib/code4/example_408_gesture_page.dart
  ///手势识别[GestureDetector]的基本使用
  Widget buildGestureDetector() {
    return GestureDetector(
      //手指抬起时的回调
      onTap: () {
        print("点击了图片");
      },
      child: Container(
        width: 200,
        height: 100,
        child: Image.asset(
          "assets/images/warning_icon.png",
        ),
      ),
    );
  }


}
